package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc TargetCycleTargeValuetDto
 * @使用场景
 */
@Data
public class TargetCycleTargeValuetDto extends BaseDto implements Serializable {

    /**
     * 被评对象目标周期ID
     */
    @NotNull(message = "被评对象目标周期ID不能为空")
    @ApiModelProperty("被评对象目标周期ID")
    private String evaObjTargetCycleId;

    /**
     * 目标值
     */
    @ApiModelProperty("目标值")
    private Double targetValue;

    /**
     * 是否父周期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否父周期不能为空")
    @ApiModelProperty("是否父周期")
    private String isParentCycle;

    /**
     * 是否子周期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否子周期不能为空")
    @ApiModelProperty("是否子周期")
    private String isSubCycle;

    /**
     * 是否中期 TRUE:是 FALSE:否
     */
    @NotNull(message = "是否中期不能为空")
    @ApiModelProperty("是否中期")
    private String isMetaphase;

    /**
     * 是否要求周期安排 TRUE:是 FALSE:否
     */
    @ApiModelProperty("是否要求周期安排")
    private String isReqCycleRange;

    /**
     * 周期ID
     */
    @ApiModelProperty("周期ID")
    private String cycleId;

    /**
     * 目标周期简称
     */
    @ApiModelProperty("目标周期简称")
    private String cyclelAlias;

    /**
     * 周期名称
     */
    @ApiModelProperty("周期名称")
    private String cycleStandardName;

    /**
     * 周期类型实例简称
     */
    @ApiModelProperty("周期类型实例简称")
    private String cycleNumberShortName;

    /**
     * 周期结束时间
     */
    @ApiModelProperty("周期结束时间")
    private Date cycleEndTime;

    /**
     * 被评对象目标设置ID
     */
    @ApiModelProperty("被评对象目标设置ID")
    private String evaObjOsetId;

    /**
     * 诊断值
     */
    @ApiModelProperty("诊断值")
    private Double targetDiagnosticValue;

    /**
     * 冗余单位
     */
    @ApiModelProperty("冗余单位")
    private String unit;

    /**
     * 运算符号 GREATER_THAN:大于 LESS_THAN:小于 EQUAL:等于 GREATER_EQUAL_THAN:大于等于 LESS_EQUAL_THAN:小于等于 ALL_NOT_EQUAL:均不低于 ALL_NOT_GREATER:均不高于
     */
    @ApiModelProperty("运算符号")
    private String logicalOperator;

    /**
     * 目标周期规划设置ID
     */
    @ApiModelProperty("目标周期规划设置ID")
    private String targetCyclePlanSetId;

    /**
     * 计划验收时间
     */
    @ApiModelProperty("计划验收时间")
    private Date acceptancePlanTime;

    /**
     * 起始值
     */
    @ApiModelProperty("起始值")
    private Double targetStartValue;

    /**
     * 目标周期名称
     */
    @ApiModelProperty("目标周期名称")
    private String targetCycleName;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空")
    @ApiModelProperty("排序")
    private Long orderNumber;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TargetCycleTargeValuetDto that = (TargetCycleTargeValuetDto) o;
        return (
                evaObjTargetCycleId == that.evaObjTargetCycleId &&
                        targetValue == that.targetValue &&
                        isParentCycle == that.isParentCycle &&
                        isSubCycle == that.isSubCycle &&
                        isMetaphase == that.isMetaphase &&
                        isReqCycleRange == that.isReqCycleRange &&
                        cycleId == that.cycleId &&
                        cyclelAlias == that.cyclelAlias &&
                        cycleStandardName == that.cycleStandardName &&
                        cycleNumberShortName == that.cycleNumberShortName &&
                        cycleEndTime == that.cycleEndTime &&
                        evaObjOsetId == that.evaObjOsetId &&
                        targetDiagnosticValue == that.targetDiagnosticValue &&
                        unit == that.unit &&
                        logicalOperator == that.logicalOperator &&
                        targetCyclePlanSetId == that.targetCyclePlanSetId &&
                        acceptancePlanTime == that.acceptancePlanTime &&
                        targetStartValue == that.targetStartValue &&
                        targetCycleName == that.targetCycleName &&
                        orderNumber == that.orderNumber
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                evaObjTargetCycleId,
                targetValue,
                isParentCycle,
                isSubCycle,
                isMetaphase,
                isReqCycleRange,
                cycleId,
                cyclelAlias,
                cycleStandardName,
                cycleNumberShortName,
                cycleEndTime,
                evaObjOsetId,
                targetDiagnosticValue,
                unit,
                logicalOperator,
                targetCyclePlanSetId,
                acceptancePlanTime,
                targetStartValue,
                targetCycleName,
                orderNumber
        );
    }

}
